package edu.zzuli.util;

import java.io.Serializable;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import edu.zzuli.common.MisException;

public class TMap<K, V> implements Map<K, V>, Serializable {

	private static final long serialVersionUID = 1L;
	
	private Map<K, V> localMap;

	public TMap(Map<K, V> map) {
		this.localMap = map;
	}

	public TMap() {
		this.localMap = new HashMap<K, V>();
	}

	public void clear() {
		localMap.clear();
	}

	public boolean containsKey(Object key) {
		return localMap.containsKey(key);
	}

	public boolean containsValue(Object value) {
		return localMap.containsValue(value);
	}

	public Set<Entry<K, V>> entrySet() {
		return localMap.entrySet();
	}

	public boolean equals(Object o) {
		return localMap.equals(o);
	}

	public int hashCode() {
		return localMap.hashCode();
	}

	public boolean isEmpty() {
		return localMap.isEmpty();
	}

	public Set<K> keySet() {
		return localMap.keySet();
	}

	public V put(K key, V value) {
		return localMap.put(key, value);
	}

	public void putAll(Map<? extends K, ? extends V> m) {
		localMap.putAll(m);
	}

	public V remove(Object key) {
		return localMap.remove(key);
	}

	public int size() {
		return localMap.size();
	}

	public Collection<V> values() {
		return localMap.values();
	}

	public V get(Object key) {
		if (!localMap.containsKey(key)) {
			new MisException("not contains key : " + key).printStackTrace();
		}
		return localMap.get(key);
	}

	public String toString() {
		return localMap.toString();
	}
}